# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gengetopt
pkgver=2.23
pkgrel=1
pkgdesc="A tool to write command line option parsing code for C programs"
arch=('i686' 'x86_64' 'arm' 'armv6h')
url="https://www.gnu.org/software/gengetopt/gengetopt.html"
license=("GPL")
options=('!docs' '!makeflags')
makedepends=('bison' 'flex' 'gcc' 'help2man')
source=(https://ftp.gnu.org/gnu/gengetopt/${pkgname}-${pkgver}.tar.xz{,.sig}
        msysize.patch)
sha256sums=('b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac'
            'SKIP'
            '803fade65b7a266ef511687a9b79a938a59ef7c9e649a2e794701a5dd592e56d')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/msysize.patch
  autoreconf -fiv
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  ./configure \
    --prefix=/usr \
    --disable-dependency-tracking

  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
